﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;

namespace Results_Comparer
{
    public class RdfId
    {
        // Fields
        private byte[] path;
        private byte[] rdfId;

        // Methods
        public RdfId(string id)
        {
            this.rdfId = new UTF8Encoding().GetBytes(id);
        }

        public string GetPath()
        {
            UTF8Encoding encoding = new UTF8Encoding();
            return encoding.GetString(this.path);
        }

        public string getPathName()
        {
            string[] strArray = this.GetPath().Split(new char[] { '\\' });
            return strArray[strArray.Length - 1];
        }

        public string GetRdfId()
        {
            UTF8Encoding encoding = new UTF8Encoding();
            return encoding.GetString(this.rdfId);
        }

        public void SetPath(string path)
        {
            this.path = new UTF8Encoding().GetBytes(path);
        }

        // Properties
        public string rdfType { get; set; }

        // Nested Types
        public class EqualityComparer : IEqualityComparer<RdfId>
        {
            // Methods
            public bool Equals(RdfId x, RdfId y)
            {
                return x.GetRdfId().Equals(y.GetRdfId());
            }

            public int GetHashCode(RdfId x)
            {
                return x.GetRdfId().GetHashCode();
            }
        }
    }
}